using System;
using Sce.PlayStation.Core;

namespace Nyanimals
{
    public class CWayPoint : CMovingObject
    {
        CollisionSphere mySphere;
        CWayPoint nextWayPoint;
        CWayPoint prevWayPoint;
        int myIndex;
        
        CStatDisplay display;
        
        public CWayPoint Next
        {
            get { return nextWayPoint;}
            set { nextWayPoint = value;}
        }        
        public CWayPoint Prev
        {
            get { return prevWayPoint;}
            set { prevWayPoint = value;}
        }        
        public CollisionSphere Sphere
        {
            get { return mySphere;}
        }
        public int MyIndex
        {
            get { return myIndex;}
        }
        
        public void DebugUpdate(float deltaTime)
        {
            display.Update(deltaTime);
        }
        
        public CWayPoint(int order, Vector3 pos, float rad)
        {
            myIndex = order;
            mySphere = new CollisionSphere(pos, rad);
            nextWayPoint = null;
            prevWayPoint = null;
            
            
#if SHOWCOLLISION
            context = mySphere.Context;
#endif
            Position = pos;
            
            display = new CStatDisplay(16, 16);
            display.Init();
            display.OwningObject = this;
            display.Context.Active = false;
            display.DrawText.AddText(order.ToString(), new CTextRender.Color(0, 0, 0, 0), 0, 0);
            display.DrawText.DrawTexts();
        }        
    }
}

